

#预测测试数据
decode_modes="ctc_greedy_search ctc_prefix_beam_search attention attention_rescoring"
dir=result_aishell_1
python3 /mnt/e/wenet/wenet/bin/recognize.py \
    --config pretrained_aishell/train.yaml \
    --test_data test/data.list \
    --checkpoint pretrained_aishell/final.pt \
    --result_dir result_aishell_1 \
    --beam_size 10 \
    --batch_size 1 \
    --modes $decode_modes 

# 2. 计算字符级WER（适用于中文）

for mode in ${decode_modes}; do
    python /mnt/e/wenet/tools/compute-wer.py --char=1 \
      test/text $dir/$mode/text > $dir/$mode/wer.txt
  done